package com.smartleanx.module.hrm.eums.employee;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 员工材料阶段分组
 */
@Getter
@RequiredArgsConstructor
public enum EmployeeStageFileEnum {


    /**
     * 员工入职资料
     */
    EMPLOYEE_ENTRY(1, "员工入职资料"),
    /**
     * 员工在职资料
     */
    EMPLOYEE_ON_THE_JOB(2, "员工在职资料"),
    /**
     * 员工离职资料
     */
    EMPLOYEE_LEAVE(3, "员工离职资料"),

    /**
     * 员工绩效考勤资料
     */
    EMPLOYEE_EXAMINE(4,"员工低绩效上传附件")

    ;

    private final Integer code;

    private final String name;

    EmployeeStageFileEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据code返回desc
     *
     * @param code 编号
     * @return 名称
     */
    public static String getName(Integer code) {
        for (EmployeeStageFileEnum e : EmployeeStageFileEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getName();
            }
        }
        return null;
    }
}
